package com.mind.adjust.service.impl;

import com.mind.system.domain.AjBasicMaterialmapping;
import com.mind.adjust.mapper.AjBasicMaterialmappingMapper;
import com.mind.adjust.service.AjBasicMaterialmappingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * (AjBasicMaterialmapping)表服务实现类
 *
 * @author makejava
 * @since 2024-12-02 13:40:00
 */
@Service("basicMaterialmappingService")
public class AjBasicMaterialmappingServiceImpl implements AjBasicMaterialmappingService {
    @Autowired
    private AjBasicMaterialmappingMapper basicMaterialmappingMapper;

    /**
     * 查询信息集合
     * 
     * @param basicMaterialmapping 信息
     * @return 信息集合
     */
    @Override
    public List<AjBasicMaterialmapping> selectBasicMaterialmappingList(AjBasicMaterialmapping basicMaterialmapping)
    {
        return basicMaterialmappingMapper.selectBasicMaterialmappingList(basicMaterialmapping);
    }

    /**
     * 通过ID查询信息
     * 
     * @param basicMaterialmappingId ID
     * @return 角色对象信息
     */
    @Override
    public AjBasicMaterialmapping selectBasicMaterialmappingById(Long basicMaterialmappingId)
    {
        return basicMaterialmappingMapper.selectBasicMaterialmappingById(basicMaterialmappingId);
    }

    /**
     * 删除信息
     * 
     * @param basicMaterialmappingId ID
     * @return 结果
     */
    @Override
    public int deleteBasicMaterialmappingById(Long basicMaterialmappingId)
    {
        return basicMaterialmappingMapper.deleteBasicMaterialmappingById(basicMaterialmappingId);
    }

    /**
     * 批量删除信息
     * 
     * @param basicMaterialmappingIds 需要删除的ID
     * @return 结果
     */
    @Override
    public int deleteBasicMaterialmappingByIds(Long[] basicMaterialmappingIds)
    {
        return basicMaterialmappingMapper.deleteBasicMaterialmappingByIds(basicMaterialmappingIds);
    }

    /**
     * 新增保存信息
     * 
     * @param basicMaterialmapping 信息
     * @return 结果
     */
    @Override
    public int insertBasicMaterialmapping(AjBasicMaterialmapping basicMaterialmapping)
    {
        return basicMaterialmappingMapper.insertBasicMaterialmapping(basicMaterialmapping);
    }

    /**
     * 修改保存信息
     * 
     * @param basicMaterialmapping 信息
     * @return 结果
     */
    @Override
    public int updateBasicMaterialmapping(AjBasicMaterialmapping basicMaterialmapping)
    {
        return basicMaterialmappingMapper.updateBasicMaterialmapping(basicMaterialmapping);
    }
    
    /**
     * 批量插入
     *
     * @param basicMaterialmappingList 附件类型信息
     * @return 结果
     */
    @Override
    public int batchInsert(List<AjBasicMaterialmapping> basicMaterialmappingList) {
        int size = 0;
        for(AjBasicMaterialmapping basicMaterialmapping: basicMaterialmappingList) {
//            if (basicMaterialmappingMapper.selectBasicMaterialmappingByName(basicMaterialmapping.getName()) == null){
//                basicMaterialmappingMapper.insertBasicMaterialmapping(basicMaterialmapping);
//                size ++;
//            }
        }
        return size;
    }
}
